#include<string>
#include<iostream>
using namespace std;
int isyuanyin(char a){
	if((a=='a' || a=='e' ||a=='i' || a=='o' ||a=='u')){
		return 1;
	}
	return 0;
}
int main(){
	string a;
	cin>>a;
	int len=a.size();
	if(a=="have"){
		cout<<"has";
	}
	else if(a[len-1]=='y' && !isyuanyin(a[len-2])){
		cout<<a.substr(0,len-1)<<"ies";
	}
	else if(a[len-1]=='s' || a[len-1]=='x' || (a[len-2]=='s'&&a[len-1]=='h') || (a[len-2]=='c'&&a[len-1]=='h') || a[len-1]=='o'){
		cout<<a;
		cout<<"es"; 
	}
	else{
		cout<<a.substr(0,len)<<"s";
	}
}
